﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class userControls_AllMoviesInFavWatch : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.ID == "fav")
        {
            fillFavoritesList();
        }
        else
        {
            fillWatchList();
        }
    }

    private void fillFavoritesList()
    {
        list.DataSource = MovieAccess.GetFavoriteMovies(Page.User.Identity.Name);
        list.DataBind();
    }

    private void fillWatchList()
    {
        list.DataSource = MovieAccess.GetWatchMovies(Page.User.Identity.Name);
        list.DataBind();
    }
}